// stairs
// using stairs takes you to another layer
// Cell 0,1 - Coordinates of layer to take to. if left at 0, uses location
//   of character using object
// Cell 2 - Direction to enter it from (0 - from north, 1 - west, 2 - south, 3 - east)
// Cell 3,4 - A stuff done flag. If one is given, this flag must be nonzero to let party use stairs
// Cell 5 - If the flag prevent party from using stairs, starts a convo at this node.

beginobjectscript; // talking object

variables;

body;

beginstate INIT_STATE;
	break;

beginstate DEAD_STATE;
	break;

beginstate START_STATE; 
	break;

beginstate USE_STATE;
	if ((get_memory_cell(3) > 0) || (get_memory_cell(4) > 0)) {
		if (get_sdf(get_memory_cell(3),get_memory_cell(4)) == 0) {
			run_text_on_obj(ME,"Lock!",0);
			begin_talk_mode(get_memory_cell(5));
			}
		}
	
	if ((object_type(ME) >= 1) && (object_type(ME) <= 25))
		play_sound(25 + get_ran(1,0,2));

	if (get_memory_cell(0) == 0)
		change_level(my_loc_x(),my_loc_y(),get_memory_cell(2) );
		else change_level(get_memory_cell(0),get_memory_cell(1),get_memory_cell(2));
break;
